<?php
//提交第12天信息
if($bigtype==15){
	$id=$_REQUEST['id'];
	$day=12;
	$difang_id=$id;
	$muoban=1;
	$zisheng_id=$_REQUEST['zisheng_id'];
	
	$xingcheng12_biaoti=$_REQUEST['xingcheng12_biaoti'];
	$xingcheng12_type1=$_REQUEST['xingcheng12_type1'];
	$xingcheng12_nairong1=$_REQUEST['xingcheng12_nairong1'];
	$xingcheng12_type2=$_REQUEST['xingcheng12_type2'];
	$xingcheng12_nairong2=$_REQUEST['xingcheng12_nairong2'];
	$xingcheng12_type3=$_REQUEST['xingcheng12_type3'];
	$xingcheng12_nairong3=$_REQUEST['xingcheng12_nairong3'];
	$xingcheng12_type4=$_REQUEST['xingcheng12_type4'];
	$xingcheng12_nairong4=$_REQUEST['xingcheng12_nairong4'];
	
	//判断该用户是否存在
	if(strlen($zisheng_id)==0){
		//账号不存在，新增数据
		$sql="INSERT INTO `xingcheng_day_info`(`difang_id`, `day`, `biaoti`, `tubiao_type1`, `nairong1`, `tubiao_type2`, `nairong2`, `tubiao_type3`, `nairong3`, `tubiao_type4`, `nairong4`, `muoban`) VALUES ('$difang_id','$day','$xingcheng12_biaoti','$xingcheng12_type1','$xingcheng12_nairong1','$xingcheng12_type3','$xingcheng12_nairong2','$xingcheng12_type3','$xingcheng12_nairong3','$xingcheng12_type4','$xingcheng12_nairong4','1')";
		$query = mysql_query($sql);		
		
	}else{
		//账号存在，更新数据
		$sql="UPDATE `xingcheng_day_info` SET `difang_id`='$difang_id',`day`='$day',`biaoti`='$xingcheng12_biaoti',`tubiao_type1`='$xingcheng12_type1',`nairong1`='$xingcheng12_nairong1',`tubiao_type2`=$xingcheng12_type2,`nairong2`='$xingcheng12_nairong2',`tubiao_type3`='$xingcheng12_type3',`nairong3`='$xingcheng12_nairong3',`tubiao_type4`='$xingcheng12_type4',`nairong4`='$xingcheng12_nairong4' WHERE id='$zisheng_id'";
		$query = mysql_query($sql);
	}
	
	echo "{";
	echo "\"code\"".":"."\"0001\",";
	echo "\"id\"".":"."\"".$id."\",";
	echo "\"reason\"".":"."\""."该用户的数据上传成功！"."\"";
	echo "}";
	exit;
}


function up_day_12(){
	zisheng_id               =        document.getElementById("zisheng_id12").innerHTML;
	xingcheng12_biaoti        =        document.getElementById("xingcheng12_biaoti").value;
	xingcheng12_type1         =        document.getElementById("xingcheng12_type1").value;
	xingcheng12_nairong1      =        document.getElementById("xingcheng12_nairong1").value;
	xingcheng12_type2         =        document.getElementById("xingcheng12_type2").value;
	xingcheng12_nairong2      =        document.getElementById("xingcheng12_nairong2").value;
	xingcheng12_type3         =        document.getElementById("xingcheng12_type3").value;
	xingcheng12_nairong3      =        document.getElementById("xingcheng12_nairong3").value;
	xingcheng12_type4         =        document.getElementById("xingcheng12_type4").value;
	xingcheng12_nairong4      =        document.getElementById("xingcheng12_nairong4").value;
	
	if(zisheng_id=="undifind"){
		zisheng_id="";
	}
	
	var url="getmessage_all.php?bigtype=15&id=<?php echo $id;?>";
	url=url+"&zisheng_id="+zisheng_id;
	url=url+"&xingcheng12_biaoti="+xingcheng12_biaoti;
	url=url+"&xingcheng12_type1="+xingcheng12_type1;
	url=url+"&xingcheng12_nairong1="+xingcheng12_nairong1;
	url=url+"&xingcheng12_type2="+xingcheng12_type2;
	url=url+"&xingcheng12_nairong2="+xingcheng12_nairong2;
	url=url+"&xingcheng12_type3="+xingcheng12_type3;
	url=url+"&xingcheng12_nairong3="+xingcheng12_nairong3;
	url=url+"&xingcheng12_type4="+xingcheng12_type4;
	url=url+"&xingcheng12_nairong4="+xingcheng12_nairong4;
	$.ajax({
		type:"GET",
		url:url,
		dataType: "json",
		success: function(data){	
			if(data['code']==0001){
				alert(data['reason']);
				window.location.href='index.php?id='+data['id'];  
			}else{
				alert(data['reason']);
			}
		}
	});
	
}













?>